package com.jsbb.controller.log;

import com.jsbb.core.Message;
import com.jsbb.core.PageVo;
import com.jsbb.dto.log.LogApiQueryDto;
import com.jsbb.service.log.LogApiService;
import com.jsbb.vo.log.LogApiVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 接口日志Controller
 *
 * @author jsbb
 */
@RestController
@RequestMapping("/log/api")
@Tag(name = "3.1 日志管理-接口日志")
public class LogApiController {

    @Autowired
    private LogApiService logApiService;

    @PostMapping("/list")
    @Operation(summary = "获取列表")
    public Message<PageVo<LogApiVo>> list(@Validated @RequestBody LogApiQueryDto queryDto) {
        PageVo<LogApiVo> pageVo = logApiService.list(queryDto);
        return Message.success(pageVo);
    }
}
